<!DOCTYPE HTML >





<html>

<head>
    <base href="https://yunjingzhi.com:443/yunjingservice/">
    <title>云净-今日医嘱</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="expires" content="0" />
    <meta http-equiv="keywords" content="云净,透析单,透析记录" />
    <link href="image/yunjing/logo.ico" type="image/x-icon" rel="shortcut icon">
    <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap-datetimepicker.min.css" />
    <style>
        * {
            padding: 0px;
            margin: 0px;
            font-family: "Microsoft YaHei", 微软雅黑, "MicrosoftJhengHei", 华文细黑, STHeiti, MingLiu;
            font-size: 14px;
        }

        .tx_container {
            /* background-color: #EFF2F6; */
        }

        .tx_menue_ul {
            list-style-type: none;
            height: 40px;
            margin-bottom: 0px;
            background-color: #F3F3F1;
        }

        .tx_menue_ul>li {
            display: inline-block;
            text-align: center;
            font-size: 14px;
            line-height: 40px;
            width: 100px;
            background-color: #ffffff;
            margin-left: 30px;
        }

        .tx_content {
            background-color: #ffffff;
            padding: 8px 12px;
            margin: 18px 30px 0px 30px;
            min-width: 1180px;
        }

        .tx_yz_searchul {
            list-style-type: none;
        }

        .tx_yz_searchul>li {
            display: inline-block;
            width: 100%;
            height: 40px;
            line-height: 40px;
            margin: 5px 0px;
        }

        .tx_yz_searchword {
            display: inline-block;
            background-color: #EFF2F6;
            width: 80px;
            text-align: center;
            border-radius: 4px;
        }

        .tx_search_label {
            color: #4579C5;
            margin: 0px 30px;
            width: 60px;
            text-align: center;
            border-radius: 8px;
            height: 30px;
            line-height: 30px;
            background-color: #ffffff;
            font-weight: normal;
        }

        .tx_search_label_active {
            background-color: #4579C5;
            color: #ffffff;
        }

        .tx_select_period {
            display: inline-block;
            width: 100px;
            margin-left: 30px;
        }

        .tx_datetime_div {
            border: 1px solid #ddd;
            display: inline-block;
            margin: 0px 30px;
            height: 34px;
            line-height: 34px;
            padding-bottom: 5px;
            border-radius: 4px;
        }

        .tx_input_datetime {
            border: 0px;
            height: 30px;
            display: inline-block;
            width: auto;
            text-align: center;
            padding: 6px;
            width: 130px;
            -webkit-box-shadow: none;
            background-color: #fff !important;
        }

        .tx_daytime_typeul {
            list-style-type: none;
            display: inline-block;
        }

        .tx_daytime_typeul>li {
            display: inline-block;
            height: 40px;
            line-height: 40px;
            margin: 0px 15px;
            text-align: center;
        }

        .tx_yzdaytime {}

        .tx_search_input {
            margin-left: 150px;
            height: 40px;
            border-radius: 20px;
            width: 250px;
            display: inline-block;
        }

        .tx_print_btn {
            background-color: #45c566;
            height: 40px;
            color: #ffffff;
            width: 120px;
            border-radius: 20px;
        }

        .tx_wxpush_btn {
            background-color: #02c3ce;
            margin-left: 30px;
            height: 40px;
            color: #ffffff;
            width: 120px;
            border-radius: 20px;
        }

        .tx_yzcheck_btn {
            background-color: #1eadf3;
            margin-left: 30px;
            height: 40px;
            color: #ffffff;
            width: 120px;
            border-radius: 20px;
        }

        #pbyztable {
            margin-bottom: 0px;
            border-bottom: 1px solid #ddd;
            border-top: 1px solid #ddd;
        }

        #pbyztable>thead>tr>td,
        #pbyztable>tbody>tr>td {
            text-align: center;
        }
    </style>
</head>

<body>






    <!DOCTYPE HTML >
    <html>

    <head>
        <base href="https://yunjingzhi.com:443/yunjingservice/">
        <title>云净-透析记录</title>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
        <meta http-equiv="pragma" content="no-cache" />
        <meta http-equiv="cache-control" content="no-cache" />
        <meta http-equiv="expires" content="0" />
        <meta http-equiv="keywords" content="云净,透析单,网页透析" />
        <link href="image/yunjing/logo.ico" type="image/x-icon" rel="shortcut icon">
        <style>
            a[title="站长统计"] {
                display: none;
            }

            .tx_top {
                width: 100%;
                height: 60px;
                background-color: #3D4B60;
                position: relative;
            }

            .tx_logo {
                position: absolute;
                top: 50%;
                margin-top: -20px;
                left: 30px;
            }

            .tx_brand {
                position: absolute;
                top: 50%;
                left: 75px;
                margin-top: -9px;
                font-size: 18px;
                color: #ffffff;
            }

            .tx_module_ul {
                list-style-type: none;
                height: 50px;
                border-bottom: 1px solid #ddd;
                margin-bottom: 0px;
                background-color: #ffffff;
            }

            .tx_module_ul>li {
                display: inline-block;
                text-align: center;
                font-size: 18px;
                line-height: 50px;
                padding: 0px 20px;
                width: 200px;
                margin: 0px;
            }

            .tx_module_liactive {
                border-bottom: 3px solid #4579C5;
                color: #4579C5;
            }
        </style>
    </head>
    <div class="tx_top noprint">
        <img class="tx_logo" src="image/yunjing/logo_gray.png" width="40px" height="40px">
        <span class="tx_brand">云净&reg;透析记录</span>
    </div>
    <ul class="tx_module_ul noprint">
        <li data-module="1">透析单</li>
        <li data-module="2">今日医嘱</li>
        <li data-module="3">透析准备</li>
    </ul>

    <script type="text/javascript" src="js/jquery/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="bootstrap/js/respond.min.js"></script>
    <script type="text/javascript" src="bootstrap/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="bootstrap/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <script type="text/javascript" src="js/layer/layer.js"></script>
    <script type="text/javascript" src="js/common/common.js"></script>
    <script src="https://s13.cnzz.com/z_stat.php?id=1263104855&web_id=1263104855" language="JavaScript"></script>
    <script>
        $(function () {
            $("ul.tx_module_ul").find("li[data-module='2']").addClass("tx_module_liactive");
            //切换模块
            $("ul.tx_module_ul>li").click(function () {
                $(this).addClass("tx_module_liactive").siblings().removeClass("tx_module_liactive");
                switch ($(this).attr("data-module")) {
                    case "1":
                        window.location.href =
                            "https://yunjingzhi.com:443/yunjingservice/user/txform.shtml";
                        break;
                    case "2":
                        window.location.href =
                            "https://yunjingzhi.com:443/yunjingservice/user/yjtxform.shtml";
                        break;
                    case "3":
                        window.location.href =
                            "https://yunjingzhi.com:443/yunjingservice/user/txform_pre.shtml";
                        break;
                    default:
                        break;
                }
            });

        });
    </script>

    </html>

    <div class="tx_container noprint" style="">
        <div class="tx_content noprint">
            <ul class="tx_yz_searchul">
                <li id="pbyztime_li">
                    <div class="tx_yz_searchword">查询日期</div>
                    <select class="form-control tx_select_period" onchange="changeperiod(this);">
                        <option value="0">当天</option>
                        <option value="1">本周</option>
                        <option value="2">本月</option>
                        <option value="3">本年</option>
                        <option value="">全部</option>
                    </select>

                    <div class="tx_datetime_div">
                        <input type="text" name="yzstart_date" class="form-control tx_input_datetime form_datetime_ymd" value="" readonly="readonly"
                            onchange="yzdatechange();" />
                        <span style="color:#999999;">—</span>
                        <input type="text" name="yzend_date" class="form-control tx_input_datetime form_datetime_ymd" value="" readonly="readonly"
                            onchange="yzdatechange();" />
                        <span class="glyphicon glyphicon-calendar" style="color: #4579C5"></span>&nbsp;
                    </div>

                    <ul class="tx_daytime_typeul">
                        <li style="color: #4c7ec7;">
                            <input type="radio" name="yzdaytime" class="tx_yzdaytime" value="" checked="checked" style="line-height: 40px;" />
                            <img src="image/yunjing/all_day.png" />&nbsp;全天&nbsp;
                            <span class="day_total_num">(29)</span>
                        </li>
                        <li style="color:#ef762e;">
                            <input type="radio" name="yzdaytime" class="tx_yzdaytime" value="0" />
                            <img src="image/yunjing/am.png" />&nbsp;上午&nbsp;
                            <span class="day_am_num">(16)</span>
                        </li>
                        <li style="color:#f27767; ">
                            <input type="radio" name="yzdaytime" class="tx_yzdaytime" value="1" style="color: red;background: green;" />
                            <img src="image/yunjing/pm.png" />&nbsp;下午&nbsp;
                            <span class="day_pm_num">(13)</span>
                        </li>
                        <li style="color:#8a97aa; ">
                            <input type="radio" name="yzdaytime" class="tx_yzdaytime" value="2" style="color: red;background: green;" />
                            <img src="image/yunjing/night.png" />&nbsp;晚上&nbsp;
                            <span class="day_night_num">(0)</span>
                        </li>
                    </ul>
                </li>
                <li id="pbyztype_li">
                    <div class="tx_yz_searchword">医嘱类型</div>
                    <label data-yztype="" class="tx_search_label tx_search_label_active">全部</label>
                    <label data-yztype="1" class="tx_search_label">长期</label>
                    <label data-yztype="0" class="tx_search_label">临时</label>
                </li>
                <li id="pbyzperiod_li">
                    <div class="tx_yz_searchword">显示范围</div>
                    <label data-yzstop="" class="tx_search_label tx_search_label_active">全部</label>
                    <label data-yzstop="1" class="tx_search_label">未停止</label>
                    <label data-yzstop="0" class="tx_search_label">已停止</label>
                </li>
                <li id="pbyzcheck_li">
                    <div class="tx_yz_searchword">医嘱核对</div>
                    <label data-yzcheck="" class="tx_search_label tx_search_label_active">全部</label>
                    <label data-yzcheck="0" class="tx_search_label">未核对</label>
                    <label data-yzcheck="1" class="tx_search_label">已核对</label>
                </li>
                <li>
                    <div class="col-md-6 col-lg-6" style="padding: 0px;">
                        <img alt="" src="image/yunjing/prescription_drug.png">&nbsp;
                        <span>医嘱列表</span>
                        <input type="text" name="pbyz_search" class="form-control tx_search_input" oninput="getyzlist();" placeholder="请输入姓名/首拼/透析号">
                    </div>
                    <div class="col-md-6 col-lg-6" style="padding: 0px;text-align: right;">
                        <button type="button" class="btn btn-success tx_print_btn" onclick="pbyzprint();">
                            <img src="image/yunjing/print.png" alt="" />&nbsp;打印</button>
                        <!-- <button type="button" class="btn btn-info tx_wxpush_btn" onclick="pbyzwechatpush();" ><img src="image/yunjing/wechat.png" alt="" />&nbsp;微信推送</button> -->
                        <!-- <button type="button" class="btn btn-info tx_yzcheck_btn" onclick="checkyz();" ><img src="image/yunjing/doctor_advice_check.png" alt="" />&nbsp;医嘱核对</button> -->
                    </div>
                </li>
            </ul>

            <table class="table table-striped yzprint_table" id="pbyztable">
                <thead>
                    <tr class="print_tr">
                        <td width="20px" class="noprint">
                            <input type="checkbox" class="check_all" value="" />
                        </td>
                        <td width="50px">序号</td>
                        <td width="85px">透析号</td>
                        <td width="65px">姓名</td>
                        <td width="50px">性别</td>
                        <td width="80px">医嘱类型</td>
                        <td width="165px">开始时间</td>
                        <td width="165px">停止时间</td>
                        <td>医嘱名称/单次用量/给药途径/频率</td>
                        <td width="80px">核对护士</td>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                </tbody>
            </table>

        </div>
    </div>

    <div class="yzcheckpage" style="display: none;">
        <div style="text-align: center;margin:30px 0px;;font-size: 16px;">确定核对选中医嘱吗？</div>
        <div style="text-align: center;font-size: 16px;">
            核对护士&nbsp;
            <select class="form-control" name="pbyz_nurse" style="width: 150px;display: inline-block;">
                <option value="张三">张三</option>
                <option value="李莎莎">李莎莎</option>
                <option value="凌强">凌强</option>
                <option value="小鱼">小鱼</option>
                <option value="蠡湖">蠡湖</option>
                <option value="瑶池">瑶池</option>
            </select>
        </div>
        <div style="text-align: center;font-size: 16px;margin-top: 30px;">
            <button type="button" class="btn btn-primary tx_checkyz_confirm_btn" onclick="confirm_checkyz();" style="margin-right: 20px;">确认</button>
            <button type="button" class="btn btn-default tx_checkyz_cancle_btn" style="margin-left: 20px;">取消</button>
        </div>
    </div>

    <table id="yzprint_table" class="print_block" style="display:none;">
        <thead>
            <tr>
                <td width="20px" class="noprint">
                    <input type="checkbox" class="check_all" value="" />
                </td>
                <td width="50px">序号</td>
                <td width="65px">透析号</td>
                <td width="65px">姓名</td>
                <td width="50px">性别</td>
                <td width="80px">医嘱类型</td>
                <td width="165px">开始时间</td>
                <td width="165px">停止时间</td>
                <td>医嘱名称/单次用量/给药途径/频率</td>
                <td width="80px">核对护士</td>
            </tr>
        </thead>
    </table>

</body>
<style media=print type="text/css">
    .noprint {
        visibility: hidden;
        display: none;
    }

    .print_tr {
        display: table-row !important;
        border-top: 1px solid #666;
    }

    .yzprint_table {
        width: 100%;
        width: 960px;
        margin: 0 auto;
        border: 1px solid #666;
    }

    .yzprint_table td {
        word-wrap: break-word;
        word-break: break-all;
        text-align: center;
        padding: 5px 0px 5px 0px;
        border-bottom: 1px solid #666;
        border-right: 1px solid #666;
    }
</style>
<script src="js/jQuery.print.js" type="text/javascript"></script>
<script>
    $(function () {
        init_datetimepicker_ymd();
        changeperiod();

        //标签选中
        $("label.tx_search_label").click(function () {
            $(this).addClass("tx_search_label_active").siblings().removeClass("tx_search_label_active");
            getyzlist();
        });

        //radio选中
        $("input[type=radio].tx_yzdaytime").click(function () {
            getyzlist();
        });

        //医嘱全选
        $("input[type=checkbox].check_all").click(function () {
            if ($(this).is(':checked')) {
                $("input[type=checkbox].tx_yz_checkbox").prop("checked", true);
                $("input[type=checkbox].tx_yz_checkbox").parents("tr").removeClass("no-print");
            } else {
                $("input[type=checkbox].tx_yz_checkbox").prop("checked", false);
                $("input[type=checkbox].tx_yz_checkbox").parents("tr").addClass("no-print");
            }
        });

        //选择医嘱记录
        $("#pbyztable").on("click", "input[type=checkbox].tx_yz_checkbox", function () {
            if ($(this).is(':checked')) {
                $(this).parents("tr").removeClass("no-print");
                if ($(this).attr("data-ischild") == "0") {
                    $("input[type=checkbox][data-fatherid=" + $(this).attr("data-yzid") + "]").prop(
                        "checked", true);
                    $("input[type=checkbox][data-fatherid=" + $(this).attr("data-yzid") + "]").parents(
                        "tr").removeClass("no-print");
                }
                if ($(this).attr("data-ischild") == "1") {
                    $("input[type=checkbox][data-yzid=" + $(this).attr("data-fatherid") + "]").prop(
                        "checked", true);
                    $("input[type=checkbox][data-yzid=" + $(this).attr("data-fatherid") + "]").parents(
                        "tr").removeClass("no-print");
                    //$("input[type=checkbox][data-fatherid="+$(this).attr("data-fatherid")+"]").prop("checked",true);
                }
            } else {
                $(this).parents("tr").addClass("no-print");
                if ($(this).attr("data-ischild") == "0") {
                    $("input[type=checkbox][data-fatherid=" + $(this).attr("data-yzid") + "]").prop(
                        "checked", false);
                    $("input[type=checkbox][data-fatherid=" + $(this).attr("data-yzid") + "]").parents(
                        "tr").addClass("no-print");
                }
                if ($(this).attr("data-ischild") == "1") {
                    $("input[type=checkbox][data-yzid=" + $(this).attr("data-fatherid") + "]").prop(
                        "checked", false);
                    $("input[type=checkbox][data-yzid=" + $(this).attr("data-fatherid") + "]").parents(
                        "tr").addClass("no-print");
                    //$("input[type=checkbox][data-fatherid="+$(this).attr("data-fatherid")+"]").prop("checked",false);
                }
            }
        });



    });

    //医嘱核对页面
    var yzcheckpage_index = null;

    function checkyz() {
        var numbers = $("input[name=tx_lsyz_id]:checked").serialize();
        if (numbers.length <= 0) {
            layer.msg("请先勾选核对医嘱！", {
                time: 500
            });
            return false;
        }
        yzcheckpage_index = layer.open({
            title: "核对医嘱",
            type: 1,
            closeBtn: 1,
            anim: 2,
            shadeClose: true,
            skin: 'layui-layer-txform',
            area: ['400px', '300px'],
            content: $('.yzcheckpage')
        });
        $("button.tx_checkyz_cancle_btn").attr("onclick", "layer.close(" + yzcheckpage_index + ")")
    }

    function confirm_checkyz() {
        var numbers = $("input[name=tx_lsyz_id]:checked").serialize();
        var tx_lsyz_hd_nurse = $("select[name='pbyz_nurse']").val();
        $.post("https://yunjingzhi.com:443/yunjingservice/user/checkyz.shtml?tx_lsyz_hd_nurse=" + tx_lsyz_hd_nurse +
            "&" + numbers,
            function () {
                getyzlist();
                parent.layer.msg("医嘱核对成功！");
                parent.layer.close(parent.yzcheckpage_index);
            }).error(function () {
            parent.layer.msg("医嘱核对出错，请稍后重试！");
        })
    }


    //微信推送
    function pbyzwechatpush() {
        //String source,String hzid,String msgids,String msg,String kzys,String hzname
        var numbers = $("input[name=tx_lsyz_id]:checked").serialize();
        if (numbers.length <= 0) {
            layer.msg("请先勾选核对医嘱！");
            return false;
        }
        var msgid = "";
        var hzids = "";
        $("input[type=checkbox].tx_yz_checkbox:checked").each(function (index) {
            msgid = msgid + "," + $(this).val();
            if (hzids.indexOf($(this).attr("data-number")) < 0) {
                hzids = hzids + "," + $(this).attr("data-number");
            }
        });
        console.log("msgid:" + msgid);
        console.log("hzids:" + hzids);

        return false;
        $.post("https://yunjingzhi.com:443/yunjingservice/manage/yzpush.shtml", {
            source: "0",
            hzids: ""
        }, function (data) {
            if (data.msg == null || data.msg == '') {
                layer.alert("推送成功");
            } else {
                layer.alert(data.msg, 3);
            }
        });
    }

    //打印
    function pbyzprint() {
        var numbers = $("input[name=tx_lsyz_id]:checked").serialize();
        if (numbers.length <= 0) {
            layer.msg("请先勾选医嘱！", {
                time: 500
            });
            return false;
        }
        //$("input[name=tx_lsyz_id]:checked").parents("tr").removeClass("no-print");
        /*   var old_body=$("body").html();
            //console.log("outerHeight:"+$("#yzprint_table").outerHeight());
            var $yzcheck=$("input[type=checkbox].tx_yz_checkbox:checked");
            $yzcheck.each(function(index){
                 $(".yzprint_table").append("<tr>"+$(this).parents("tr").html()+"</tr>");
            });
            //console.log("outerHeight:"+$("#yzprint_table").outerHeight());
            window.print();
            $("body").html(old_body); */
        $.print("#pbyztable");
    }

    //时间改变
    function yzdatechange() {
        var yzstart_date = $("input[name='yzstart_date']").val();
        var yzend_date = $("input[name='yzend_date']").val();
        if (new Date(yzstart_date.replace(/-/g, "/")).getTime() > new Date(yzend_date.replace(/-/g, "/")).getTime()) {
            layer.msg("开始时间不能大于结束时间！");
            return false;
        }
        getyzlist();
    }

    //获取医嘱列表  
    function getyzlist() {
        var tx_advicestyle = $("#pbyztype_li").find("label.tx_search_label_active").attr("data-yztype");
        var yzstop = $("#pbyzperiod_li").find("label.tx_search_label_active").attr("data-yzstop");
        var yzcheck = $("#pbyzcheck_li").find("label.tx_search_label_active").attr("data-yzcheck");
        var yzstart_date = $("#pbyztime_li").find("input[name='yzstart_date']").val();
        var yzend_date = $("#pbyztime_li").find("input[name='yzend_date']").val();
        var tx_pdrq_type = $("ul.tx_daytime_typeul").find("input[name='yzdaytime'][type='radio']:checked").val();
        var keywords = $("input[name='pbyz_search']").val();
        getyzlistByparam(tx_advicestyle, yzstop, yzcheck, yzstart_date, yzend_date, tx_pdrq_type, keywords);
    }

    function getyzlistByparam(tx_advicestyle, yzstop, yzcheck, yzstart_date, yzend_date, tx_pdrq_type, keywords) {
        $.ajaxSetup({
            async: false
        });
        $("#pbyztable tbody").empty();
        $("tr.print_tr").find("input.check_all").prop("checked", false);
        $.post("https://yunjingzhi.com:443/yunjingservice/user/getsearchpbyzlist.shtml", {
            tx_advicestyle: tx_advicestyle,
            yzstop: yzstop,
            yzcheck: yzcheck,
            yzstart_date: yzstart_date,
            yzend_date: yzend_date,
            tx_pdrq_type: tx_pdrq_type,
            keywords: keywords
        }, function (data) {
            if (data.res == null || data.res.length == 0) {
                $("#pbyztable>tbody").append(
                    "<tr><td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td></tr>" +
                    "<tr><td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td></tr>" +
                    "<tr><td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td></tr>" +
                    "<tr><td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td></tr>" +
                    "<tr><td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td></tr>"
                );
                //layer.msg("没有查询到相关医嘱记录信息！");
                return false;
            }
            var index_num = 0;
            $.each(data.res, function (index, item) {
                if (item.tx_is_child == '0') {
                    index_num = index_num + 1;
                    //主医嘱
                    $("#pbyztable>tbody").append(
                        "<tr class='no-print'><td class='no-print'><input type='checkbox' name='tx_lsyz_id' class='tx_yz_checkbox' value='" +
                        item.tx_lsyz_id + "' data-ischild='0' data-yzid='" + item.tx_lsyz_id +
                        "' data-number='" + item.tx_number + "'  /></td> <td>" + index_num +
                        "</td> <td>" + item.tx_number + "</td> <td>" + item.tx_name + "</td> <td>" +
                        (item.tx_sex == 'F' ? "女" : "男") + "</td>" +
                        "<td>" + (item.tx_advicestyle == '1' ? "长期" : "临时") + "</td> <td>" + (item.tx_lsyz_kssj ==
                            null ? "" : item.tx_lsyz_kssj.substring(0, 19)) + "</td> <td>" + (item.tx_stopdate ==
                            null ? "" : item.tx_stopdate.substring(0, 19)) + "</td>" +
                        "<td>" + item.tx_advicename + "/" + item.tx_singledosage + item.tx_singledosage_unit +
                        "/" + item.tx_wayadminister + "/" + item.tx_frequency + "</td> <td>" + (
                            item.tx_lsyz_hd_nurse == null ? "" : item.tx_lsyz_hd_nurse) + "</td>" +
                        "</tr>"
                    );
                    //子医嘱
                    $.each(data.res, function (index, it) {
                        if (it.tx_father_id == item.tx_lsyz_id) {
                            index_num = index_num + 1;
                            $("#pbyztable>tbody").append(
                                "<tr class='no-print'><td class='no-print'><input type='checkbox' name='tx_lsyz_id' class='tx_yz_checkbox' value='" +
                                it.tx_lsyz_id + "' data-ischild='1' data-fatherid='" + item
                                .tx_lsyz_id + "' data-number='" + item.tx_number +
                                "'  /></td><td>" + index_num +
                                "</td><td></td><td></td><td></td><td></td><td></td><td></td>" +
                                "<td>" + it.tx_advicename + "/" + it.tx_singledosage + it.tx_singledosage_unit +
                                "/" + it.tx_wayadminister + "/" + it.tx_frequency + "</td>" +
                                "<td>" + (it.tx_lsyz_hd_nurse == null ? "" : it.tx_lsyz_hd_nurse) +
                                "</td></tr>");
                        }
                    });
                }
            });
        });
    }

    //时间范围切换
    function changeperiod() {
        var t = $(".tx_select_period").val();
        var now = new Date(); //当前日期 
        var nowDayOfWeek = now.getDay(); //今天本周的第几天 
        var nowDay = now.getDate(); //当前日 
        var nowMonth = now.getMonth(); //当前月 
        var nowYear = now.getFullYear(); //当前年 
        switch (t) {
            case "0":
                var now = getNowymdDate();
                $("input[name='yzstart_date']").val(now);
                $("input[name='yzend_date']").val(now);
                break;
            case "1":
                $("input[name='yzstart_date']").val(formatDate(new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 1)));
                $("input[name='yzend_date']").val(formatDate(new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 7)));
                break;
            case "2":
                $("input[name='yzstart_date']").val(formatDate(new Date(nowYear, nowMonth, 1)));
                $("input[name='yzend_date']").val(formatDate(new Date(new Date(nowYear, nowMonth + 1, 1) - 1000 * 60 *
                    60 * 24)));
                break;
            case "3":
                $("input[name='yzstart_date']").val(formatDate(new Date(nowYear, 0, 1)));
                $("input[name='yzend_date']").val(formatDate(new Date(nowYear, 11, 31)));
                break;
            case "":
                $("input[name='yzstart_date']").val("");
                $("input[name='yzend_date']").val("");
                break;
            default:
                break;
        }
        getyzlist();
    }


    function formatDate(date) {
        var myyear = date.getFullYear();
        var mymonth = date.getMonth() + 1;
        var myweekday = date.getDate();
        if (mymonth < 10) {
            mymonth = "0" + mymonth;
        }
        if (myweekday < 10) {
            myweekday = "0" + myweekday;
        }
        return (myyear + "-" + mymonth + "-" + myweekday);
    }

    function init_datetimepicker_ymd() {
        $(".form_datetime_ymd").datetimepicker({
            format: 'yyyy-mm-dd',
            language: 'zh-CN',
            weekStart: 1,
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            minView: 2,
            forceParse: 0,
            keyboardNavigation: 1,
            forceParse: 1
        });
    }
</script>
<script>
    //设置cookie(超期时间，单位分钟)
    function setcookie(name, value, expiredays) {
        var exdate = new Date();
        exdate.setTime(exdate.getTime() + expiredays * 1000 * 60);
        document.cookie = name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString())
    }
    //获取cookie
    function getcookie(name) {
        var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
        if (arr != null) {
            return unescape(arr[2]);
        }
        return "";
    }
    //删除cookie(设置一个超期时间为过去的时间)
    function delcookie(name) {
        setcookie(name, "", -1);
    }

    //获取当前时间
    function getNowFormatDate() {
        var date = new Date();
        var seperator1 = "-";
        var seperator2 = ":";
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate +
            " " + date.getHours() + seperator2 + date.getMinutes() +
            seperator2 + date.getSeconds();
        return currentdate;
    }

    function getNowymdDate() {
        var date = new Date();
        var seperator1 = "-";
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        return date.getFullYear() + seperator1 + month + seperator1 + strDate;
    }

    function getNowHiDate() {
        var date = new Date();
        var i = date.getMinutes();
        if (i >= 0 && i <= 9) {
            i = "0" + i;
        }
        var h = date.getHours();
        if (h >= 0 && h < 10) {
            h = "0" + h;
        }
        return h + ":" + i;
    }

    function checkhi(str) {
        if (str == null || str == "") {
            return false;
        }
        return new RegExp(/^([01]\d|2[0-3]):([0-5]\d)$/).test(str);
    }
</script>

</html>